/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "song_tone_song")
//@NamedQueries({@NamedQuery(name = "SongToneSong.findAll", query = "SELECT s FROM SongToneSong s"), @NamedQuery(name = "SongToneSong.findBySongId", query = "SELECT s FROM SongToneSong s WHERE s.songToneSongPK.songId = :songId"), @NamedQuery(name = "SongToneSong.findByRingtoneId", query = "SELECT s FROM SongToneSong s WHERE s.songToneSongPK.ringtoneId = :ringtoneId")})
public class SongToneSong implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected SongToneSongPK songToneSongPK;

    public SongToneSong() {
    }

    public SongToneSong(SongToneSongPK songToneSongPK) {
        this.songToneSongPK = songToneSongPK;
    }

    public SongToneSong(int songId, int ringtoneId) {
        this.songToneSongPK = new SongToneSongPK(songId, ringtoneId);
    }

    public SongToneSongPK getSongToneSongPK() {
        return songToneSongPK;
    }

    public void setSongToneSongPK(SongToneSongPK songToneSongPK) {
        this.songToneSongPK = songToneSongPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (songToneSongPK != null ? songToneSongPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SongToneSong)) {
            return false;
        }
        SongToneSong other = (SongToneSong) object;
        if ((this.songToneSongPK == null && other.songToneSongPK != null) || (this.songToneSongPK != null && !this.songToneSongPK.equals(other.songToneSongPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.SongToneSong[songToneSongPK=" + songToneSongPK + "]";
    }

}
